home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / alangsbs.zip / DISPID.SRC < prev    next >
Text File  |  1992-03-12  |  2KB  |  46 lines

  1. ;---------------------------------------------------------------
  2. ;   DispID  --  Identifies the installed display adapter
  3. ;   Last update 3/12/92
  4. ;
  5. ;   1 entry point:
  6. ;
  7. ;   DispID:
  8. ;      Caller passes no parameters
  9. ;      Routine returns a code value in AX.
  10. ;      The codes are these:
  11. ;      0 : Adapter is unknown; recommend aborting
  12. ;      1 : MDA (Monochrome Display Adapter)
  13. ;      2 : CGA (Color Graphics Adapter)
  14. ;
  15. ;---------------------------------------------------------------
  16.  
  17. DispID     PROC
  18.            mov  AH,1AH      ; Select PS/2 Identify Adapter Service
  19.            xor  AL,AL       ; Select Get Combination Code Subservice (AL=0)
  20.            int  10H         ; Call VIDEO
  21.            cmp  AL,1AH      ; If AL comes back with 1AH, we have a PS/2
  22.            jne  TryEGA      ; If not, jump down to test for the EGA
  23.            mov  AL,BL       ; Put Combination Code into AL
  24.            ret              ;   and go home!
  25. TryEGA:    mov  AH,12H      ; Select EGA Alternate Function
  26.            mov  BX,10H      ; Select Get Configuration Information subservice
  27.            int  10H         ; Call VIDEO
  28.            cmp  BX,10H      ; If BX comes back unchanged, EGA is *not* there
  29.            je   OldBords    ; Go see whether it's an MDA or CGA
  30.            cmp  BH,0        ; If BH = 0, it's an EGA/color combo
  31.            je   EGAColor    ;   otherwise it's EGA/mono
  32.            mov  AL,5        ; Store code 5 for EGA mono
  33.            ret              ;   and go home!
  34. EGAColor:  mov  AL,4        ; Store code 4 for EGA color
  35.            ret              ;   and go home!
  36. OldBords:  int  11H         ; Call Equipment Configuration interrupt
  37.            not  AL          ; Flip all bits in AL to opposite states
  38.            test AL,30H      ; If bits 4 & 5 are both = 0, it's an MDA
  39.            jne  CGA         ;   otherwise it's a CGA
  40.            mov  AL,1        ; Store code 1 for MDA
  41.            ret              ;   and go home!
  42. CGA:       mov  AL,2        ; Store code 2 for CGA
  43.            ret              ;   and go home!
  44. DispID     ENDP
  45.  
  46.